//
//  DrawViewTool.m
//  TY_MotorRemoteControl
//
//  Created by xiaomei su on 2018/3/2.
//  Copyright © 2018年 xuweixin. All rights reserved.
//

#import "DrawViewTool.h"

@implementation DrawViewTool
-(void)dreawTriangleWith:(CGPoint)point1 andPoint2:(CGPoint)point2 andPoint3:(CGPoint)point3 andFillColor:(UIColor *)color superView:(UIView *)superView{
    
    [superView drawRect:superView.frame];
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGPoint points[3];
    points[0] = point1;
    points[1] = point2;
    points[2] = point3;
    CGContextAddLines(context, points, 3);
    CGContextSetFillColorWithColor(context, color.CGColor);
    CGContextClosePath(context);
    CGContextDrawPath(context, kCGPathFill);
}
@end
